<?php
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );

//moo tools framework
JHtml::_('behavior.framework', true);
JHtml::_('bootstrap.framework');

include_once (dirname(__FILE__).'/helpers/content.helper.php');

//page wide params
$id			= JRequest::getInt('id');
$view		= JRequest::getString('view');
$results    = ContentHelper::getAdditionalColumns($id, $view); 
$siteUrl	= ContentHelper::getSiteUrl();
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>">
<head>
<jdoc:include type="head" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/system.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/general.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ;?>/css/default.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ;?>/css/menu.css" type="text/css" />
<script type="text/javascript">
var addthis_config = {
    data_track_clickback: true
}
</script>

<script type="text/javascript" src="templates/<?php echo $this->template ?>/js/jquery.js"></script>
<script type="text/javascript" src="templates/<?php echo $this->template ?>/js/menu.js"></script>
<script type="text/javascript">window.google_analytics_uacct = "UA-8612509-2";</script>


<link href="<?php echo $siteUrl ?>templates/<?php echo $this->template ?>/js/video-js/video-js.css" rel="stylesheet">
<script type="text/javascript" src="<?php echo $siteUrl ?>templates/<?php echo $this->template ?>/js/video-js/video.js"></script>

  <script>
  //mvp - if it is IE9 - the first line tests for IE9 - then fall back to flash
  if(navigator.userAgent.indexOf("Trident/5")>-1){
  	_V_.options.techOrder = ["flash"];
    _V_.options.flash.swf = "<?php echo $siteUrl ?>templates/<?php echo $this->template ?>/swf/video-js.swf";
  }
  </script>
 
</head>



<body>
<div class="pagewidth">
    <div id="header_col1">
    <strong>Where am I?</strong> | 
      <jdoc:include type="modules" name="breadcrumb" />
    </div>
    <div id="header_col2">
      <a target="_blank" href="http://www.wholesalersusainc.com/"><img alt="Shop Wholesalers USA" title="Shop Wholesalers USA" src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/images/wholesalers-usa.jpg" /></a>
    </div>
  <div style='clear: both;'></div><!-- new row -->

<!-- Logo -->
  <div id="header_logo">
    <a href="/blog/"><img alt="Crafts USA by Wholesalers USA" title="Crafts USA by Wholesalers USA" src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/images/logo.gif" /></a>
  </div>
  <div id="header_search">
    <jdoc:include type="modules" name="search" /> <br />
    <jdoc:include type="modules" name="facebook" />
  </div>
  <div style='clear: both;'></div><!-- new row -->

<!-- Menu -->
  <div id="menu_wrap">
    <div id="menu">
      <jdoc:include type="modules" name="menu" />
    </div>
  </div>



<!-- Front Page -->
  <?php if( JRequest::getVar( 'view' ) == 'frontpage' ): ?>
  <div class="top_image">
    <jdoc:include type="modules" name="top_image_text" />
  </div>
  <div style='clear: both;'></div><!-- new row -->
  <div class="content">
    <script type="text/javascript"><!--
    google_ad_client = "ca-pub-9493856472396436";
    /* Crafts USA - 728x90 */
    google_ad_slot = "6634092336";
    google_ad_width = 728;
    google_ad_height = 90;
    //-->
    </script>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>
  </div>
<!-- Front Page Left Column Content Layout -->
  <div class="content_col_left">
    <h3>Featured Crafts</h3>
    <div class="three_boxes_left">
      <a href="http://www.wholesalersusainc.com/blog/family-crafts/glass-gem-wreath.html" title="Glass Gem Wreath"><img alt="Glass Gem Wreath" width="172" height="103" src="http://www.wholesalersusainc.com/blog/images/videos/glass-gem-wreath-craft.jpg" /></a>
      <strong>Glass Gem Wreath</strong>
      <p>This is an easy and fun craft project. These glass wreaths can be re-purposed for many occasions by adding different bows, ribbons, and decorations. You can also use this glass gem wreath as a table centerpiece, just place on a table and add a vase or other decorations to the center.</p>
      <p><a href="http://www.wholesalersusainc.com/blog/family-crafts/glass-gem-wreath.html" title="Glass Gem Wreath">View Project Video</a></p>
      <jdoc:include type="modules" name="frontpage_three_boxes_left">
    </div>
    <div class="three_boxes_middle">
      <a href="http://www.wholesalersusainc.com/blog/family-crafts/monogram-frame-craft.html" title="Monogram Frame"><img alt="Monogram Frame" width="172" height="103" src="http://www.wholesalersusainc.com/blog/images/videos/monogram-frame-craft.jpg" /></a>
      <strong>Monogram Frame</strong>
      <p>Trendy yet unique, this altered monogram frame is the perfect addition to your collage photo wall, yet stands beautifully on its own as well! Monogram letter can be painted or decoupaged and accented with gorgeous washi paper and glass gems.</p>
     <p><a href="http://www.wholesalersusainc.com/blog/family-crafts/monogram-frame-craft.html" title="Monogram Frame">View Project Video</a></p>
      <jdoc:include type="modules" name="frontpage_three_boxes_middle">
    </div>
    <div class="three_boxes_right">
      <a href="http://www.wholesalersusainc.com/blog/kids-crafts/travel-tic-tac-toe-craft.html" title="Travel Tic Tac Toe"><img alt="Travel Tic Tac Toe" width="172" height="103" src="http://www.wholesalersusainc.com/blog/images/videos/travel-tic-tac-toe-craft.jpg" /></a>
      <strong>Travel Tic Tac Toe</strong>
      <p>This is one project the whole family can enjoy creating together and playing together! Beat the 'Are we there yet?' traveling blues with a rousing round of Tic Tac Toe! This game is guaranteed travel friendly with no little pieces to go missing and it stores neatly all in one small pan!</p>
      <p><a href="http://www.wholesalersusainc.com/blog/kids-crafts/travel-tic-tac-toe-craft.html" title="Travel Tic Tac Toe">View Project Video</a></p>
      <jdoc:include type="modules" name="frontpage_three_boxes_right">
    </div>
  </div>
<!-- Front Page Right Column Content Layout -->
  <div class="content_col_right">
    <jdoc:include type="modules" name="col_right_1" style="xhtml" />
    <jdoc:include type="modules" name="col_right_2" style="xhtml" />
    <jdoc:include type="modules" name="col_right_3" style="xhtml" />
  </div>
  <div style='clear: both;'></div>
  <?php endif; ?>
<!-- End of Front Page -->



<!-- Article Page -->
  <?php if( JRequest::getVar( 'view' ) == 'article' ): ?>
  <?php
    $transcript_contents = file_get_contents( JPATH_BASE . '/images/videos/' . $results->article_transcript);
	$transcript_contents = str_replace('"', "", $transcript_contents);
  ?>
  <div class="top_image">
    <?php if ($results->article_video){ ?>
	   <div class="top_image_left" itemprop="video" itemscope itemtype="http://schema.org/VideoObject">
		<meta itemprop="name" content="<?php echo $results->schemaorg_meta_name?>">
		<meta itemprop="thumbnailUrl" content="<?php echo $siteUrl ?>images/videos/<?php echo $results->article_image?>" />
		<meta itemprop="description" content="<?php echo $results->schemaorg_meta_description?>" />
		<meta itemprop="transcript" content="<?php echo $transcript_contents ?>" />
		<meta itemprop="contentURL" content="<?php echo $siteUrl ?>images/videos/<?php echo $results->article_video?>" />
		<meta itemprop="embedURL" content="<?php echo $siteUrl ?>images/videos/<?php echo $results->article_video?>" />
		<meta itemprop="uploadDate" content="<?php echo $results->created?>" />	   		
	    <video id="video_preview" class="video-js vjs-default-skin" controls preload="none" width="640" height="360"
		      poster="<?php echo $this->baseurl ?>/images/videos/<?php echo $results->article_image?>" data-setup="{}">
			    <source src="<?php echo $siteUrl . 'images/videos/' . basename($results->article_video, '.mp4').'.mp4' ?>" type='video/mp4' />
			    <track kind="captions" src="<?php echo $siteUrl ?>images/videos/<?php echo $results->article_transcript?>" srclang="en" label="English" >
  		</video>	    
	  </div>
    <?php	
    } else {
    ?>
    	<div class="top_image_left">
  	    	<img alt="<?php echo $this->title?>" src="<?php echo $this->baseurl ?>/images/videos/<?php echo $results->article_image?>" /><br />
  	    </div>
    <?php 
    }
    ?> 
	<div class="top_image_right">
		<?php echo $results->article_short_desc; ?>
		
		<form id="SearchForm" action="" enctype="multipart/form-data">
		<!-- AddThis Button BEGIN -->
		<script type="text/javascript">var addthis_pub = "<?php echo $this->title ?>";</script>
		<a href="http://www.addthis.com/bookmark.php" onmouseover="return addthis_open(this, '', '[URL]', '[TITLE]')" onmouseout="addthis_close()" onclick="return addthis_sendto()"><img src="http://s7.addthis.com/static/btn/lg-bookmark-en.gif" width="125" height="16" alt="" /></a><script type="text/javascript" src="http://s7.addthis.com/js/152/addthis_widget.js"></script>
		<!-- AddThis Button END -->
		</form>
	</div>
  </div>
  <div style='clear: both;'></div><!-- new row -->
  <div class="content">
    <script type="text/javascript"><!--
    google_ad_client = "ca-pub-9493856472396436";
    /* Crafts USA - 728x90 */
    google_ad_slot = "6634092336";
    google_ad_width = 728;
    google_ad_height = 90;
    //-->
    </script>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>
  </div>
  <div class="content_col_left">
    <jdoc:include type="component" />
  </div>
<!-- Article Page Right Column Content Layout -->
  <div class="content_col_right">
    <jdoc:include type="modules" name="col_right_1" style="xhtml" />
    <jdoc:include type="modules" name="col_right_2" style="xhtml" />
    <jdoc:include type="modules" name="col_right_3" style="xhtml" />
  </div>
  <div style='clear: both;'></div> 
  <?php endif; ?>
<!-- End of Article Page -->

<!-- Category Page -->
  <?php if( JRequest::getVar( 'view' ) == 'category' ): ?>
  <div class="top_image">
    <jdoc:include type="modules" name="top_image_text" />
  </div>
  <div class="top_image_only">
    <jdoc:include type="modules" name="top_image_left" />
  </div>
  <div style='clear: both;'></div><!-- new row -->
  <div class="content_category">
    <script type="text/javascript"><!--
    google_ad_client = "ca-pub-9493856472396436";
    /* Crafts USA - 728x90 */
    google_ad_slot = "6634092336";
    google_ad_width = 728;
    google_ad_height = 90;
    //-->
    </script>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>
  </div>
  <div class="content_col_left">
    <jdoc:include type="component" />
  </div>
<!-- Article Page Right Column Content Layout -->
  <div class="content_col_right">
    <jdoc:include type="modules" name="col_right_1" style="xhtml" />
    <jdoc:include type="modules" name="col_right_2" style="xhtml" />
    <jdoc:include type="modules" name="col_right_3" style="xhtml" />
  </div>
  <div style='clear: both;'></div>  
  <?php endif; ?>
<!-- End of Category Page -->

<!-- Section Page -->
  <?php if( JRequest::getVar( 'view' ) == 'section' ): ?>
  <div class="top_image">
    <jdoc:include type="modules" name="top_image_text" />
  </div>
  <div style='clear: both;'></div><!-- new row -->
  <div class="content">
    <script type="text/javascript"><!--
    google_ad_client = "ca-pub-9493856472396436";
    /* Crafts USA - 728x90 */
    google_ad_slot = "6634092336";
    google_ad_width = 728;
    google_ad_height = 90;
    //-->
    </script>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>
  </div>
  <div class="content_col_left">
    <jdoc:include type="component" />
  </div>
<!-- Article Page Right Column Content Layout -->
  <div class="content_col_right">
    <jdoc:include type="modules" name="col_right_1" style="xhtml" />
    <jdoc:include type="modules" name="col_right_2" style="xhtml" />
    <jdoc:include type="modules" name="col_right_3" style="xhtml" />
  </div>
  <div style='clear: both;'></div>  
  <?php endif; ?>
<!-- End of Section Page -->

<!-- Search View -->
  <?php if( JRequest::getVar( 'view' ) == 'search' ): ?>
  <div class="content">
		<jdoc:include type="component" />
  </div>
  <?php endif; ?>
<!-- End of Search View -->

</div>
<p>Copyright &copy; 2013 <a href="http://www.wholesalersusainc.com/" title="Wholesalers USA, Inc.">Wholesalers USA, Inc.</a>, All Rights Reserved.<br /><br /></p>


<!-- Google Tracking BEGIN -->
<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-231296-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>
<!-- Google Tracking END -->  
        				
</body>
</html>